
var app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    Performance: '',
    D_list: [
      {"code":40,"text1":11.54,"text2":13.04,"text3":12.00,"text4":9.60,"text5":2.86,"text6":2.40},
      {"code":39.5,"text1":11.59,"text2":13.14,"text3":11.89,"text4":9.50,"text5":2.84,"text6":2.38},
      {"code":39,"text1":11.64,"text2":13.24,"text3":11.78,"text4":9.40,"text5":2.83,"text6":2.37},
      {"code":38.5,"text1":11.69,"text2":13.34,"text3":11.67,"text4":9.30,"text5":2.81,"text6":2.36},
      {"code":38,"text1":11.74,"text2":13.44,"text3":11.56,"text4":9.20,"text5":2.80,"text6":2.35},
      {"code":37.5,"text1":11.79,"text2":13.54,"text3":11.45,"text4":9.10,"text5":2.79,"text6":2.33},
      {"code":37,"text1":11.84,"text2":13.64,"text3":11.34,"text4":9.00,"text5":2.78,"text6":2.32},
      {"code":36.5,"text1":11.89,"text2":13.74,"text3":11.23,"text4":8.90,"text5":2.77,"text6":2.31},
      {"code":36,"text1":11.94,"text2":13.84,"text3":11.12,"text4":8.80,"text5":2.75,"text6":2.30},
      {"code":35.5,"text1":11.99,"text2":13.94,"text3":11.02,"text4":8.71,"text5":2.74,"text6":2.29},
      {"code":35,"text1":12.04,"text2":14.04,"text3":10.92,"text4":8.62,"text5":2.73,"text6":2.27},
      {"code":34.5,"text1":12.09,"text2":14.14,"text3":10.82,"text4":8.53,"text5":2.71,"text6":2.26},
      {"code":34,"text1":12.14,"text2":14.24,"text3":10.72,"text4":8.44,"text5":2.70,"text6":2.25},
      {"code":33.5,"text1":12.19,"text2":14.34,"text3":10.62,"text4":8.35,"text5":2.69,"text6":2.24},
      {"code":33,"text1":12.23,"text2":14.44,"text3":10.52,"text4":8.26,"text5":2.68,"text6":2.22},
      {"code":32.5,"text1":12.28,"text2":14.54,"text3":10.42,"text4":8.17,"text5":2.66,"text6":2.21},
      {"code":32,"text1":12.32,"text2":14.64,"text3":10.32,"text4":8.08,"text5":2.65,"text6":2.20},
      {"code":31.5,"text1":12.37,"text2":14.74,"text3":10.22,"text4":7.99,"text5":2.64,"text6":2.19},
      {"code":31,"text1":12.41,"text2":14.84,"text3":10.12,"text4":7.90,"text5":2.62,"text6":2.17},
      {"code":30.5,"text1":12.46,"text2":14.94,"text3":10.02,"text4":7.81,"text5":2.61,"text6":2.16},
      {"code":30,"text1":12.50,"text2":15.04,"text3":9.92,"text4":7.72,"text5":2.60,"text6":2.15},
      {"code":29.5,"text1":12.55,"text2":15.14,"text3":9.82,"text4":7.63,"text5":2.59,"text6":2.14},
      {"code":29,"text1":12.59,"text2":15.24,"text3":9.72,"text4":7.54,"text5":2.57,"text6":2.12},
      {"code":28.5,"text1":12.64,"text2":15.34,"text3":9.61,"text4":7.45,"text5":2.56,"text6":2.11},
      {"code":28,"text1":12.68,"text2":15.44,"text3":9.50,"text4":7.36,"text5":2.55,"text6":2.10},
      {"code":27.5,"text1":12.73,"text2":15.54,"text3":9.40,"text4":7.27,"text5":2.54,"text6":2.09},
      {"code":27,"text1":12.77,"text2":15.64,"text3":9.30,"text4":7.18,"text5":2.52,"text6":2.07},
      {"code":26.5,"text1":12.82,"text2":15.74,"text3":9.20,"text4":7.09,"text5":2.51,"text6":2.06},
      {"code":26,"text1":12.86,"text2":15.84,"text3":9.10,"text4":7.00,"text5":2.50,"text6":2.05},
      {"code":25.5,"text1":12.91,"text2":15.94,"text3":9.00,"text4":6.90,"text5":2.48,"text6":2.03},
      {"code":25,"text1":12.95,"text2":16.04,"text3":8.90,"text4":6.80,"text5":2.47,"text6":2.02},
      {"code":24.5,"text1":13.00,"text2":16.14,"text3":8.80,"text4":6.70,"text5":2.46,"text6":2.01},
      {"code":24,"text1":13.04,"text2":16.24,"text3":8.70,"text4":6.60,"text5":2.45,"text6":2.00},
      {"code":23.5,"text1":13.09,"text2":16.34,"text3":8.59,"text4":6.51,"text5":2.43,"text6":1.98},
      {"code":23,"text1":13.14,"text2":16.44,"text3":8.48,"text4":6.42,"text5":2.42,"text6":1.97},
      {"code":22.5,"text1":13.19,"text2":16.54,"text3":8.37,"text4":6.33,"text5":2.41,"text6":1.96},
      {"code":22,"text1":13.24,"text2":16.64,"text3":8.26,"text4":6.24,"text5":2.39,"text6":1.94},
      {"code":21.5,"text1":13.29,"text2":16.74,"text3":8.15,"text4":6.15,"text5":2.38,"text6":1.93},
      {"code":21,"text1":13.34,"text2":16.84,"text3":8.05,"text4":6.06,"text5":2.37,"text6":1.92},
      {"code":20.5,"text1":13.39,"text2":16.94,"text3":7.95,"text4":5.97,"text5":2.35,"text6":1.90},
      {"code":20,"text1":13.44,"text2":17.04,"text3":7.85,"text4":5.88,"text5":2.34,"text6":1.89},
      {"code":19.5,"text1":13.49,"text2":17.14,"text3":7.74,"text4":5.79,"text5":2.33,"text6":1.88},
      {"code":19,"text1":13.54,"text2":17.24,"text3":7.63,"text4":5.70,"text5":2.32,"text6":1.86},
      {"code":18.5,"text1":13.59,"text2":17.34,"text3":7.52,"text4":5.61,"text5":2.30,"text6":1.85},
      {"code":18,"text1":13.64,"text2":17.44,"text3":7.41,"text4":5.52,"text5":2.29,"text6":1.84},
      {"code":17.5,"text1":13.69,"text2":17.54,"text3":7.30,"text4":5.43,"text5":2.28,"text6":1.82},
      {"code":17,"text1":13.74,"text2":17.64,"text3":7.20,"text4":5.34,"text5":2.26,"text6":1.81},
      {"code":16.5,"text1":13.79,"text2":17.74,"text3":7.10,"text4":5.25,"text5":2.25,"text6":1.80},
      {"code":16,"text1":13.84,"text2":17.84,"text3":7.00,"text4":5.16,"text5":2.24,"text6":1.78},
      {"code":15.5,"text1":13.88,"text2":17.94,"text3":6.90,"text4":5.07,"text5":2.23,"text6":1.77},
      {"code":15,"text1":13.93,"text2":18.04,"text3":6.80,"text4":4.98,"text5":2.21,"text6":1.76},
      {"code":14.5,"text1":13.97,"text2":18.14,"text3":6.70,"text4":4.89,"text5":2.20,"text6":1.74},
      {"code":14,"text1":14.02,"text2":18.24,"text3":6.60,"text4":4.80,"text5":2.19,"text6":1.73},
      {"code":13.5,"text1":14.06,"text2":18.34,"text3":6.50,"text4":4.70,"text5":2.17,"text6":1.72},
      {"code":13,"text1":14.11,"text2":18.44,"text3":6.40,"text4":4.60,"text5":2.16,"text6":1.70},
      {"code":12.5,"text1":14.15,"text2":18.54,"text3":6.30,"text4":4.50,"text5":2.15,"text6":1.69},
      {"code":12,"text1":14.20,"text2":18.64,"text3":6.20,"text4":4.40,"text5":2.14,"text6":1.67},
      {"code":11.5,"text1":14.24,"text2":18.74,"text3":6.09,"text4":4.30,"text5":2.12,"text6":1.66},
      {"code":11,"text1":14.29,"text2":18.84,"text3":5.98,"text4":4.20,"text5":2.11,"text6":1.65},
      {"code":10.5,"text1":14.33,"text2":18.94,"text3":5.87,"text4":4.10,"text5":2.10,"text6":1.63},
      {"code":10,"text1":14.38,"text2":19.04,"text3":5.76,"text4":4.00,"text5":2.08,"text6":1.62},
      {"code":9.5,"text1":14.42,"text2":19.14,"text3":5.65,"text4":3.90,"text5":2.07,"text6":1.61},
      {"code":9,"text1":14.47,"text2":19.24,"text3":5.54,"text4":3.80,"text5":2.06,"text6":1.59},
      {"code":8.5,"text1":14.51,"text2":19.34,"text3":5.43,"text4":3.70,"text5":2.05,"text6":1.58},
      {"code":8,"text1":14.56,"text2":19.44,"text3":5.32,"text4":3.60,"text5":2.03,"text6":1.56},
      {"code":7.5,"text1":14.60,"text2":19.54,"text3":5.21,"text4":3.50,"text5":2.02,"text6":1.55},
      {"code":7,"text1":14.65,"text2":19.64,"text3":5.10,"text4":3.40,"text5":2.01,"text6":1.53},
      {"code":6.5,"text1":14.69,"text2":19.74,"text3":5.00,"text4":3.30,"text5":1.99,"text6":1.52},
      {"code":6,"text1":14.74,"text2":19.84,"text3":4.90,"text4":3.20,"text5":1.98,"text6":1.51},
      {"code":5.5,"text1":14.79,"text2":19.94,"text3":4.80,"text4":3.10,"text5":1.97,"text6":1.49},
      {"code":5,"text1":14.84,"text2":20.04,"text3":4.70,"text4":3.00,"text5":1.95,"text6":1.48},
      {"code":4.5,"text1":14.89,"text2":20.14,"text3":4.60,"text4":2.90,"text5":1.94,"text6":1.46},
      {"code":4,"text1":14.94,"text2":20.24,"text3":4.50,"text4":2.80,"text5":1.93,"text6":1.45},
      {"code":3.5,"text1":14.99,"text2":20.34,"text3":4.40,"text4":2.70,"text5":1.92,"text6":1.44},
      {"code":3,"text1":15.04,"text2":20.44,"text3":4.30,"text4":2.60,"text5":1.90,"text6":1.43},
      {"code":2.5,"text1":15.09,"text2":20.54,"text3":4.20,"text4":2.50,"text5":1.89,"text6":1.41},
      {"code":2,"text1":15.14,"text2":20.64,"text3":4.10,"text4":2.40,"text5":1.88,"text6":1.39},
      {"code":1.5,"text1":15.19,"text2":20.74,"text3":4.00,"text4":2.30,"text5":1.86,"text6":1.38},
      {"code":1,"text1":15.24,"text2":20.84,"text3":3.90,"text4":2.20,"text5":1.85,"text6":1.36},
      


    ],
    inputValue: ''

  },

  a: function(){
    a: 10
  },
  b: function(){
    b: 11
  },


get_input: function(e){
  this.setData({
    Performance: e.detail.value
  })
  var temp=this.data.Performance;
  console.log("e  is :",e)
},
// #### 计算100米成绩
Performance100mMan: function (e) {
  var temp=this.data.Performance;
  var D_list1 = this.data.D_list;
  var score = [];
  for (var i = 0; i < D_list1.length; i++) {
    if ( temp < 11 ) {
      score = "看一道闪电！";
      break
    }
    else if ( temp <= D_list1[i].text1) {
      score = D_list1[i].code;
      break
    }
    else {
      score = "潜力无限"
    }
  }
  
  console.log("成绩:",temp,"分数:",score);
  this.setData({
    score_data: score
  })
},

Performance100mWoMan: function (e) {
  var temp=this.data.Performance;
  console.log("is e",e)
  var D_list1 = this.data.D_list;
  var score = [];
  for (var i = 0; i < D_list1.length; i++) {
    if ( temp < 11 ) {
      score = "看一道闪电！";
      break
    }
    else if ( temp <= D_list1[i].text2) {
      score = D_list1[i].code;
      break
    }
    else {
      score = "潜力无限"
    }
  }
  
  console.log("成绩:",temp,"分数:",score);
  this.setData({
    score_data: score
  })
},


//  计算 铅球成绩

PerformanceShutMan: function (e) {
  var temp=this.data.Performance;
  var D_list1 = this.data.D_list;
  var score = [];
  for (var i = 0; i < D_list1.length; i++) {
    if ( temp > 20 ) {
      score = "ennn  我错过了什么"
    }
    else if ( temp >= D_list1[i].text3 ) {
      score = D_list1[i].code;
      break
    }
    else if ( temp < 3.9) {
      score = "ennmm 砸到脚了！";
      break

    }
    else {
      // break
    }
  }
  console.log("成绩:",temp,"分数:",score);
  this.setData({
    score_data: score
  })
},

PerformanceShutWoMan: function (e) {
  var temp=this.data.Performance;
  var D_list1 = this.data.D_list;
  var score = [];
  for (var i = 0; i < D_list1.length; i++) {
    if ( temp > 15 ) {
      score = "ennn  我错过了什么"
    }
    else if ( temp >= D_list1[i].text4 ) {
      score = D_list1[i].code;
      break
    }
    else if ( temp < 2.2) {
      score = "ennmm 砸到脚了！";
      break

    }
    else {
      // break
    }
  }
  console.log("成绩:",temp,"分数:",score);
  this.setData({
    score_data: score
  })
},


// 计算立定跳


PerformanceSljMan: function (e) {
  var temp=this.data.Performance;
  var D_list1 = this.data.D_list;
  var score = [];
  for (var i = 0; i < D_list1.length; i++) {
    if ( temp > 4 ) {
      score = "ennn  我错过了什么"
    }
    else if ( temp >= D_list1[i].text5 ) {
      score = D_list1[i].code;
      break
    }
    else if ( temp < 1 ) {
      score = "再接再厉！";
      break

    }
    else {
      // break
    }
  }
  console.log("成绩:",temp,"分数:",score);
  this.setData({
    score_data: score
  })
},

PerformanceSljWoMan: function (e) {
  var temp=this.data.Performance;
  var D_list1 = this.data.D_list;
  var score = [];
  for (var i = 0; i < D_list1.length; i++) {
    if ( temp > 3.5 ) {
      score = "ennn  我错过了什么"
    }
    else if ( temp >= D_list1[i].text6 ) {
      score = D_list1[i].code;
      break
    }
    else if ( temp < 1) {
      score = "再接再厉";
      break

    }
    else {
      // break
    }
  }
  console.log("成绩:",temp,"分数:",score);
  this.setData({
    score_data: score
  })
},


  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {


  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})